﻿@using OSBLE.Models.Assignments;
@using OSBLE.Models;
@model Assignment
@section Header
{
<script src="@Url.Content("~/areas/AssignmentWizard/Content/js/deliverables.js")" type="text/javascript"></script>
}
<p>@ToolTips.BasicAssignmentDeliverables</p>
@Html.ValidationSummary() 
@Html.HiddenFor(m => m.ID)
<table class="wizard_entry_table">
<tr>
    <th>@Html.LabelFor(m => m.IsAnnotatable):</th>
    <td>@Html.EditorFor(m => m.IsAnnotatable)</td>
    <td>@Html.ValidationMessageFor(m => m.IsAnnotatable)</td>
</tr>
</table>
<table id="deliverables_table" cellspacing="6px">
    <tr>
        <td>
            File&nbsp;Name
        </td>
        <td>
            <input type="text" id="new_deliverable_name" />
        </td>
    </tr>
    <tr>
        <td>
            Type
        </td>
        <td>
            <select id="new_deliverable_type">
                @foreach (SelectListItem dt in ViewBag.DeliverableTypes)
                {
                    <option value="@dt.Value">@dt.Text</option>
                }
            </select>
        </td>
    </tr>
</table>
    
<div>
    <a href="#" id="add_new_deliverable" title="Add New Deliverable" style="text-decoration: none;">
        <img src="@Url.Content("~/Content/images/add_up.png")" alt="Add New Deliverable" />
        Add Deliverable </a>
</div>

<div id="deliverable_data">
</div>
    
<div id="deliverables_after">
</div>
    
<script type="text/javascript">
    $(function () {
        @foreach (Deliverable deliverable in Model.Deliverables)
        {
            <text>
            addNewDeliverable(true, { name: '@deliverable.Name', fileType: @deliverable.Type});
            </text>
        }
    });       
</script>
